<?php 
class Silk_Pms_Block_Adminhtml_Renderer_Template extends Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Abstract{
	public function render(Varien_Object $row)
	{
	    $tid = $row->getTemplateId();
	    $id = $row->getId();
	    if($tid){
	    	$url =  $this->getUrl('admin_promotion/adminhtml_exchange/edit')."exchange_id/".$id."/template_id/".$tid;
	    	return  '<a href=' . $url . '>编辑模版</a>';
	    }else{
	    	$url =  $this->getUrl('admin_promotion/adminhtml_exchange/edit')."exchange_id/".$id."/template_id/0";
	    	return  '<a href=' . $url . '>添加模版</a>';
	    }

	}
}
?>
